1. Field of the Invention
The present invention relates to a numerical controller which controls a machine tool. Particularly, the present invention relates to a numerical controller having a function of driving and controlling each shaft of a machine tool based on data stored in a table format.
2. Description of the Related Art
There is a well-known numerical controller having a function (path table operation) of storing, in a memory, table format data (path table) in which a position of an axis is set on the basis of time, a spindle position or a feed shaft position serving as a reference, not on the basis of instructions in a block of an NC program, and driving each axis of a machine tool while reading out the table format data in sequence (see Japanese Patent Application Laid-Open Nos. 59-177604 and 2003-303005). This constitution allows free operation of tools regardless of instructions from a block of a machining program, and reduction in machining time and enhancement of accuracy of machining can be realized.
FIGS. 10, 11A and 11B are block diagrams of a path table operation disclosed in Japanese Patent Application Laid-Open No. 2003-303005 and views showing an example of a path table.
A numerical controller shown in FIG. 10, which performs the path table operation, includes a reference value counter 1, an X-axis path table Tx, a Z-axis path table Tz, an X-axis path table interpolation processing unit 4x, a Z-axis path table interpolation processing unit 4z, an X-axis motor 5x of a feed shaft, and a Z-axis motor 5z. A path table of FIG. 11B shows an example of the X-axis path table Tx, and the position of the X axis is stored with respect to time, a spindle position, or a feed shaft position. A graph of FIG. 11A is a graph showing the position of the X axis moved based on the path table Tx of FIG. 11B.
Japanese Patent Application Laid-Open No. 2006-302208 discloses an operation based on table format data wherein a unique reference value is provided for each of a plurality of paths so that the table format data belonging to each of the paths is operated with the use of the reference value corresponding to the path and a technique of waiting for the operation of the table format data of the plurality of paths.
FIG. 12 is a block diagram of path table operation disclosed in Japanese Patent Application Laid-Open No. 2006-302208. FIGS. 13A and 13B are views showing an example of a path table when the path table operation is waited in two paths.
A numerical controller shown in FIG. 12, which performs the path table operation, includes two paths including a path 1 and a path 2. The paths 1 and 2 respectively include X-axis path table T1x for path 1, Z-axis path table T2z for path 2, a reference value counter 1 (3-1), a reference value counter 2 (3-2), X-axis path table interpolation processing unit (4-1x) for path 1, a Z-axis path table interpolation processing unit (4-2z) for path 2, X-axis motor (5-1x) for path 1, and Z-axis motor (5-2z) for path 2. FIG. 13A shows an X-axis path table for path 1. FIG. 13B shows a Z-axis path table for path 2. In the X axis of path 1 and the Z axis of path 2, waiting is performed by a path waiting command P12 at a reference time or position.
In the operation based on the table format data (path table operation), a time of passing through each point in a program path is designated by the table format data, whereby all axes are operated in synchronism with a reference time. Similarly, a time of outputting a command to a spindle and an auxiliary function command is designated by the table format data, whereby all the spindle commands and the auxiliary function commands are output in synchronism with the reference time. In the conventional operation based on the table format data, since it is assumed that all axes in a path, a spindle, and an auxiliary function are operated in synchronism with one another, the reference time is shared in a path (see FIG. 10).
When an external apparatus such as an actuator using oil pressure and air pressure is controlled by the auxiliary function, a time from output of the auxiliary function to completion of the operation of the external apparatus may be indefinite. In the operation based on the table format data, when an auxiliary function in which an operating time is indefinite is executed, and, at the same time, the spindle or the feed shaft is driven, there are following two methods:
1) while the table format data of the auxiliary function in which a surplus time is added to a maximum operating time of the auxiliary function and the table format data of the spindle or the feed shaft are read out in sequence from a memory, the auxiliary function is executed, and the spindle and the feed shaft are driven (see FIGS. 14A to 14C and FIG. 15).
2) counting of reference is stopped from the start of the execution of the auxiliary function to the end thereof, and meanwhile, the spindle and the feed shaft are stopped (see FIGS. 16A to 16C and FIG. 17).
In the method of 1), the surplus time is added to the maximum operating time of the auxiliary function, whereby since the table format data of the auxiliary function is longer than an actual operating time, there is a problem that a cycle time is increased. When operation is performed by a path table with a path table number 1000 shown in FIGS. 14A to 14C, as shown in FIG. 15, a time obtained by adding a surplus time to the maximum operating time of an auxiliary function M1234 in which operating time is indefinite and which is instructed at L2.0 is L2.0 to L7.0, and therefore, even if M1234 is completed at L5.0, the next auxiliary function, M2345, cannot be output up to L8.0. For example in FIG. 15, the maximum operating time of M1234 plus surplus time includes L2.0 to L7.0, even though M1234 is completed at L5.0 in the Path Table. The next auxiliary function can be output from this point.
In the method of 2), since the feed shaft and the spindle cannot be driven while counting of reference is stopped, machining and machining preparation cannot be performed during execution of the auxiliary function, and therefore, there is a problem that the cycle time is increased. When the operation using the path table with a path table number 2000 shown in FIGS. 16A to 16C is performed, counting of a reference time is stopped until completion of the auxiliary function M1234 which is instructed at L2.0 and in which the operating time is indefinite, and therefore, the operations of the feed shaft and the spindle are stopped in the meantime (see FIG. 17). For example in FIG. 17, time serving as reference is stopped until completion of M1234, and meanwhile, feed shaft and spindle are stopped. Time serving as reference is started after completion of M1234, and feed shaft and spindle are operable from the point on the table of FIG. 17 with reference time of 3.0.